/**
 * Copyright 2009-2010 - YangJiandong(chunquedong)
 * 
 * This file is part of ChunMap project
 * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE(Version >=3)
 * 你可以自由复制、传播本项目的下载包文件，但必须保持其完整性。
 * 我们不用对使用中的风险及由此造成的损失承担任何责任。
 * 详细情况请见《ChunMap许可协议》。

 * 想了解更多有关ChunMap的信息，请访问http://code.google.com/p/chunmap/
 */
package chunmap.service;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import chunmap.util.Logger;

public class RequestDispatcher extends HttpServlet {
	private static final long serialVersionUID = 8504367870459274730L;
	private static final Logger Log = new Logger(Logger.Debug,RequestDispatcher.class
			.getName());

	@Override
	public void service(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, java.io.IOException {

		String serviceStr = request.getParameter("SERVICE");
		Service ser = ServiceFactory.getService(serviceStr);
		
		if(Log.isDubug()){
			Log.debug("收到服务请求："+serviceStr);
		}

		ser.service(request, response);
	}
}
